package com.runen.infinitemovement.adapter;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.module.LoadMoreModule;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.runen.infinitemovement.R;
import com.runen.infinitemovement.model.entity.MyDynamicListEntity;
import com.runen.infinitemovement.tool.GlideUtils;
import com.runen.infinitemovement.widget.imageview.RoundedCornersImage;
import com.runen.rxnetlibrary.utils.TimeUtil;

public class SystemNotificationAdapter extends BaseQuickAdapter<MyDynamicListEntity.DataBean, BaseViewHolder>implements LoadMoreModule {
    private Context context;

    public SystemNotificationAdapter(Context context) {
        super(R.layout.item_system_notification);
        this.context = context;
    }

    @Override
    protected void convert(@NonNull BaseViewHolder helper, MyDynamicListEntity.DataBean item) {
        RoundedCornersImage rci_user_header = helper.getView(R.id.rci_user_header);
        GlideUtils.loadImage(context, item.headImage+"?x-oss-process=image/resize,m_fill,w_144,h_144", rci_user_header);
        helper.setText(R.id.tv_system_name, item.userName);
        helper.setText(R.id.tv_comment_info, item.content);
        helper.setText(R.id.tv_time, TimeUtil.converFromSecondTime(TimeUtil.getDateTimeToLong(TimeUtil.dealDateFormat1(item.createTime))));
    }
}
